package com.jing.gen.controller;


import com.jing.gen.domain.User;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;

@Validated
@RestController
public class TestController {

    @GetMapping("/get")
    String get(@NotBlank(message = "不能为空")String name){
        return name;
    }

    @PostMapping("/save")
    User save(@Valid @RequestBody User user){
        return user;
    }

}
